<template>
	<view class="container">
		<view class="center u-f-ajc">
			<image src="/static/images/icon-finish.png" mode="aspectFill"></image>
		</view>
		<view class="u-f-jsb">
			<view>所属加注站</view>
			<view>{{ detail.siteName }}</view>
		</view>
		<view class="u-f-jsb">
			<view>储液桶编号</view>
			<view>{{ detail.macName || detail.name }}1</view>
		</view>
		<view class="u-f-jsb">
			<view>本次补液量（吨）</view>
			<view>{{ detail.recordNum | kg2ton }}</view>
		</view>
		<view class="u-f-jsb">
			<view>补液后余量（吨）</view>
			<view>{{ detail.actualRestWeight | kg2ton }}</view>
		</view>
		<view class="u-f-jsb">
			<view>补液完成时间</view>
			<view>{{ detail.recordTime }}</view>
		</view>
		<view class="btn" @tap="goback"><button type="default">确认</button></view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			detail: ''
		};
	},
	onLoad(options) {
		this.recordId = options.recordId || '';
		this.siteId = options.siteId || '';
		this.getDatail();
	},
	methods: {
		getDatail() {
			this.$u.api._getRecordDetail({ recordId: this.recordId }).then(res => {
				console.log(res);
				this.detail = res;
			});
		},
		goback() {
			uni.navigateBack({
				success: () => {
					// setTimeout(() => {
					// 	uni.$emit('supplyFinished', {
					// 		siteId: this.siteId,
					// 		supplyAmount: this.detail.recordNum
					// 	});
					// }, 300);
				}
			});
		}
	}
};
</script>

<style lang="scss">
.container {
	padding: 30rpx;
	> view {
		margin: 20rpx 0;
		font-size: 32rpx;
		> view:nth-child(1) {
			color: #888;
		}
	}
}
.center {
	margin: 30rpx 0 60rpx 0 !important;
	image {
		width: 256rpx;
		height: 256rpx;
	}
}

.btn {
	margin-top: 200rpx !important;
	button {
		background-color: #1296db;
		color: #ffffff;
	}
}
</style>
